package com.sokal.easycare.modules.product.entity.product;

import org.hibernate.validator.constraints.Length;
import com.sokal.easycare.modules.product.entity.catalog.ProCatalog;
import javax.validation.constraints.NotNull;
import com.sokal.easycare.modules.product.entity.brand.ProBrand;
import com.sokal.easycare.modules.product.entity.factory.ProFactory;
import com.sokal.easycare.modules.service.entity.SerService;

import java.util.List;
import com.google.common.collect.Lists;

import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 产品Entity
 * 
 * @author liliangdong
 * @version 2017-03-12
 */
public class ProProduct extends DataEntity<ProProduct> {

	private static final long serialVersionUID = 1L;
	private String name; // 产品/配件名称
	private ProCatalog proCatalog; // 所属目录
	private ProBrand proBrand; // 所属品牌
	private ProFactory proFactory; // 所属厂家
	private String type; // 类型
	private String barCode; // 条形码
	private String twoDimlCode; // 二维码/图片地址
	private String bandId; // 品牌标识
	private String outerId; // 商家外部编码
	private String partyId; // 原厂代理人人标示
	private Double originalPrice; // 出厂价
	private Double sellingPrice; // 销售价
	private String isFenxiao; // 是否分销商品
	private String isRecommend; // 是否推荐商品
	private String defaultPic;// 默认缩略图路径
	private Double number; // 销售数量
	private String content; // 产品详情
	private Double received;// 好评率
	private List<ProAttribute> proAttributeList = Lists.newArrayList(); // 子表属性列表
	private List<ProProductFile> proProductFile = Lists.newArrayList(); // 子表图片列表
	private List<ProComment> proCommentList = Lists.newArrayList(); // 子表评论列表
	private List<SerService> serServicesList = Lists.newArrayList();// 产品相关服务

	public ProProduct() {
		super();
	}

	public ProProduct(String id) {
		super(id);
	}

	@Length(min = 1, max = 100, message = "产品/配件名称长度必须介于 1 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@NotNull(message = "所属目录不能为空")
	public ProCatalog getProCatalog() {
		return proCatalog;
	}

	public void setProCatalog(ProCatalog proCatalog) {
		this.proCatalog = proCatalog;
	}

	@NotNull(message = "所属品牌不能为空")
	public ProBrand getProBrand() {
		return proBrand;
	}

	public void setProBrand(ProBrand proBrand) {
		this.proBrand = proBrand;
	}

	@NotNull(message = "所属厂家不能为空")
	public ProFactory getProFactory() {
		return proFactory;
	}

	public void setProFactory(ProFactory proFactory) {
		this.proFactory = proFactory;
	}

	@Length(min = 1, max = 1, message = "类型长度必须介于 1 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Length(min = 0, max = 64, message = "条形码长度必须介于 0 和 64 之间")
	public String getBarCode() {
		return barCode;
	}

	public void setBarCode(String barCode) {
		this.barCode = barCode;
	}

	@Length(min = 0, max = 200, message = "二维码/图片地址长度必须介于 0 和 200 之间")
	public String getTwoDimlCode() {
		return twoDimlCode;
	}

	public void setTwoDimlCode(String twoDimlCode) {
		this.twoDimlCode = twoDimlCode;
	}

	@Length(min = 0, max = 64, message = "品牌标识长度必须介于 0 和 64 之间")
	public String getBandId() {
		return bandId;
	}

	public void setBandId(String bandId) {
		this.bandId = bandId;
	}

	@Length(min = 0, max = 64, message = "商家外部编码长度必须介于 0 和 64 之间")
	public String getOuterId() {
		return outerId;
	}

	public void setOuterId(String outerId) {
		this.outerId = outerId;
	}

	@Length(min = 0, max = 64, message = "原厂代理人人标示长度必须介于 0 和 64 之间")
	public String getPartyId() {
		return partyId;
	}

	public void setPartyId(String partyId) {
		this.partyId = partyId;
	}

	@NotNull(message = "出厂价不能为空")
	public Double getOriginalPrice() {
		return originalPrice;
	}

	public void setOriginalPrice(Double originalPrice) {
		this.originalPrice = originalPrice;
	}

	@NotNull(message = "销售价不能为空")
	public Double getSellingPrice() {
		return sellingPrice;
	}

	public void setSellingPrice(Double sellingPrice) {
		this.sellingPrice = sellingPrice;
	}

	@Length(min = 0, max = 1, message = "是否分销商品长度必须介于 0 和 1 之间")
	public String getIsFenxiao() {
		return isFenxiao;
	}

	public void setIsFenxiao(String isFenxiao) {
		this.isFenxiao = isFenxiao;
	}

	@Length(min = 0, max = 1, message = "是否推荐长度必须介于 0 和 1 之间")
	public String getIsRecommend() {
		return isRecommend;
	}

	public void setIsRecommend(String isRecommend) {
		this.isRecommend = isRecommend;
	}

	public Double getNumber() {
		return number;
	}

	public void setNumber(Double number) {
		this.number = number;
	}

	public String getDefaultPic() {
		return defaultPic;
	}

	public void setDefaultPic(String defaultPic) {
		this.defaultPic = defaultPic;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<ProAttribute> getProAttributeList() {
		return proAttributeList;
	}

	public void setProAttributeList(List<ProAttribute> proAttributeList) {
		this.proAttributeList = proAttributeList;
	}

	public List<ProProductFile> getProProductFile() {
		return proProductFile;
	}

	public void setProProductFile(List<ProProductFile> proProductFile) {
		this.proProductFile = proProductFile;
	}

	public List<ProComment> getProCommentList() {
		return proCommentList;
	}

	public void setProCommentList(List<ProComment> proCommentList) {
		this.proCommentList = proCommentList;
	}

	public List<SerService> getSerServicesList() {
		return serServicesList;
	}

	public void setSerServicesList(List<SerService> serServicesList) {
		this.serServicesList = serServicesList;
	}

	public Double getReceived() {
		return received;
	}

	public void setReceived(Double received) {
		this.received = received;
	}

}